package hu.uniobuda.nik.openday;

import hu.uniobuda.nik.openday.pagerindicator.CirclePageIndicator;
import hu.uniobuda.nik.openday.pagerindicator.ViewPagerAdapter;
import android.app.Activity;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;

public class LearnWhyActivity extends Activity implements OnItemSelectedListener {
	
	View windowTitleLayout;	
	String[] whyLearnDescription;
	private CirclePageIndicator mIndicator;
	private ViewPager mPager;
	private ViewPagerAdapter mAdapter;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.learn_why);
		setTitle(R.string.menu_learn_why);
		
		windowTitleLayout = findViewById(R.id.windowTitleLayout);
		mAdapter = new ViewPagerAdapter(this);
		
		mPager = (ViewPager)findViewById(R.id.pager);
		mPager.setAdapter(mAdapter);
		
		mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
		mIndicator.setViewPager(mPager);
		
	}
	
	@Override
	public void onConfigurationChanged(Configuration newConfig) {
		if(newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE){
			windowTitleLayout.setVisibility(View.GONE);
		}else if(newConfig.orientation == Configuration.ORIENTATION_PORTRAIT){
			windowTitleLayout.setVisibility(View.VISIBLE);
		}
		super.onConfigurationChanged(newConfig);
	}
	
	
	
	@Override
	public void onNothingSelected(AdapterView<?> a) {}
	@Override
	public void onItemSelected(AdapterView<?> a, View v, int i, long l) {
		
	}	
}
